package com.gec.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    //测试从配置文件中获取属性值
    @Value("${test.hello:Test}")
    private String testHello;

    @GetMapping("/hello")
    public String hello(){
        return "Hello World!";
    }

    @PostMapping("/hello/post")
    public String helloPost(String name){
        return "Hello World!"+name;
    }

    @GetMapping("/testHello")
    public String testHello(){
        return "Hello World!"+testHello;
    }
}
